result = t.match(/([0-9a-f]?[0-9a-f])[:-]([0-9a-f]?[0-9a-f])[:-]([0-9a-f]?[0-9a-f])[:-]([0-9a-f]?[0-9a-f])[:-]([0-9a-f]?[0-9a-f])[:-]([0-9a-f]?[0-9a-f])/i);
if (result){
// modify and return here
a = RegExp.$1;
b = RegExp.$2;
c = RegExp.$3;
d = RegExp.$4;
e = RegExp.$5;
f = RegExp.$6;
if (a.length == 1) { a = "0" + a; }
if (b.length == 1) { b = "0" + b; }
if (c.length == 1) { c = "0" + c; }
if (d.length == 1) { d = "0" + d; }
if (e.length == 1) { e = "0" + e; }
if (f.length == 1) { f = "0" + f; }
newaddr = a + b + "." + c + d + "." + e + f;
document.deff.q.value = newaddr;
document.deff.q.createTextRange().select();
return true;
}
result = t.match(/([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])\.([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])\.([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])/i);